<h1>分类列表</h1>
<table width="100%"   cellspacing="4" cellpadding="4" border="0" align="center" bgcolor="#f0f0f0">
<tbody>
<tr BGCOLOR=#FFCC33>
    <td>Category</td>
    <td>Type</td>
    <td>Position</td>  
    <td>Action</td> 
</tr>

  
<% for category in @categories %>
  <tr>
    <td><%=link_to category.title ,{:controller => "/admin/category", :action => "view",:id=>category},{:title=>category.description}%>(<%=category.topics_count%>)</td>
    <td><%=link_to category.type.title ,{:controller => "/admin/type", :action => "view",:id=>category.type_id},{:title=>category.type.description}%></td>
    <td><%=link_to category.position ,{}%></td>  
    
    <td><%= link_to 'Show', :action => 'show', :id => category %>
    ,<%= link_to 'Edit', :action => 'edit', :id => category %>
    ,<%= link_to 'Destroy', { :action => 'destroy', :id => category }, :confirm => 'Are you sure?', :method => :post %></td>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @category_pages.current.previous } if @category_pages.current.previous %>
<%= link_to 'Next page', { :page => @category_pages.current.next } if @category_pages.current.next %> 

<br />

<%= link_to 'New category', :action => 'new' %>
